package com.grade.service.Impl;

import com.grade.Beans.Student;
import com.grade.Beans.Teacher;
import com.grade.mapper.TeacherMapper;
import com.grade.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;
@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
     TeacherMapper teacherMapper;
    @Override
    public List<Teacher> findAll() {
       return teacherMapper.findAll();
    }

    @Override
    public Teacher findById(int id) {
        return teacherMapper.findById(id);
    }

    @Override
    public int insert(Teacher teacher) {
        return teacherMapper.insert(teacher);
    }

    @Override
    public int update(Teacher teacher) {
        return teacherMapper.update(teacher);
    }

    @Override
    public int delete(int id) {
        return teacherMapper.delete(id);
    }

    @Override
    public int updatepassword(String tname, String password) {
        return teacherMapper.updatepassword(tname,password);
    }


    @Override
    public Teacher login(String tname, String tpass) {
        return teacherMapper.login(tname,tpass);
    }
/**
 * set方法注入对象
 * public void setTeacherMapper(TeacherMapper teacherMapper) {
 *         this.teacherMapper = teacherMapper;
 *     }
 * */
}
